<?php
/**
 * @package    Joomla.Tutorials
 * @subpackage Components
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_2
 * @license    GNU/GPL
*/
 
// No direct access
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
jimport( 'joomla.application.component.view');
 
/**
 * HTML View class for the JobsWorld Component
 *
 * @package    JobsWorld
 */
 
class JobsViewJobs extends JView
{
    function display($tpl = null)
    {
		global $mainframe, $option;
        $model = &$this->getModel();
		
		/*
		$items		= $this->get('data');
		$total		= $this->get('total');
		$pagination	= &$this->get('pagination');
		
		$mainframe->setUserState($option.'filter_state','P');
		$mainframe->setUserState($option.'filter_order_Dir','DESC');
		
		$this->assignRef( 'items',	$items );
		$this->assignRef( 'total',	$total );
		$this->assignRef( 'pagination',	$pagination );
		$this->assignRef( 'model',	$model );
		*/
		/*
		$rows = $model->getListJobs($model->getState('limitstart'), $model->getState('limit'));
		$this->assignRef( 'rows',	$rows );
		$rows_total = $model->getTotalJobs();
		
		$pagination	= $model->getPagination($rows_total);
		$this->assignRef( 'pagination',	$pagination );
		$this->assignRef( 'model',	$model );
		*/
		
		/*
        $greeting = $model->getGreeting();
        $this->assignRef( 'greeting',	$greeting );
 		*/
		//$lists = array();		
		//$lists['pris'] 			= JHTML::_('list.category',  'catid', 'com_jobs',null,null,null,1,0);
		//$this->assignRef('lists',		$lists);
		
		$items_job = JModel::getInstance( 'myjobs', 'JobsModel');
		
		$defalt_pris =  array(0=>(object)array("id"=>0,"title"=>"Vælg pris"));
		$lpris = $items_job->getListPris();
		//$lpris =array_merge($defalt_pris,$lpris);
		
		$pris_html = '<select id="catid" name="catid">';
		$pris_html .= '<option value="0">Vælg pris</option>';
		$pris_html .= '<option value="56">Ved ikke</option>';
		for($i=0;$i<sizeof($lpris);$i++) 
		{
			if($lpris[$i]->id!=56){
		     	$pris_html .= '<option value="'.$lpris[$i]->id.'">'.$lpris[$i]->title.'</option>';
			}
		}
		$pris_html .= '</select>';
		
		$this->assignRef('pris_html',		$pris_html);
		
		//$this->assignRef('lists',		$lists);
		
		$session =& JFactory::getSession();
		$session->set('email_post_jobs','');
        parent::display($tpl);
    }
}
?>